package com.code260.ss.guice.demo.bill;

import com.google.inject.Guice;
import com.google.inject.Injector;

public class TestMain {

    public static void main(String[] args) {

        /**
         * 1. 以module创建injector
         */
        Injector injector = Guice.createInjector(new BillingModule());

        RealBillingService billingService = injector.getInstance(RealBillingService.class);
        billingService.chargeOrder(null,null);

        TestCustomAnnotationBillingService testCustomAnnotationBillingService = injector.getInstance(TestCustomAnnotationBillingService.class);
        testCustomAnnotationBillingService.chargeOrder(null,null);

        TestNamedBillingService testNamedBillingService = injector.getInstance(TestNamedBillingService.class);
        testNamedBillingService.chargeOrder(null,null);

    }
}
